1. Field of the Invention
The present invention relates to a data width conversion apparatus for converting data having various data widths sequentially generated into data each having a predetermined fixed data width and sequentially outputting the same, and a data processing apparatus, having a structure corresponding to such a data width conversion apparatus, for executing a receiving processing for input data and sequentially outputting a result of the processing in form of output data of the fixed data width.
2. Description of the Related Art
Recently, there are widely performed various types of data communications, for example, a packet communication on a network such as Internet, and a communication for image data obtained through a digital video. Those data communications need a complicated data processing. In the data communications, a series of data is divided in accordance with contents of processing to perform a necessary data processing on a data unit, and after the processing, the divided data are combined to a series of data. To achieve this, there is a need of processing that data having various data widths after the data processing are converted into data each having a predetermined fixed data width.
To convert data having various data widths into data having fixed data width, generally, there is adopted such a system that a shift register is used and whenever a predetermined data length of data is stored in the shift register, an output is performed.
However, according to such a system, it is impossible to process various widths of data in unit of data, and it is obliged to process the data in unit of fixed length such as unit of bit or unit of byte. Thus, it takes a long processing time, since the processing in unit of fixed length is performed for various widths of data. This involves such a problem that a communication speed is lowered.
With respect to a technology of conversion of data width, it is proposed for example in Japanese Patent Laid Open Gazette Sho.63-296158, Japanese Patent Laid Open Gazette Sho.64-31252, Japanese Patent Laid Open Gazette Hei.4-119446 and Japanese Patent Laid Open Gazette Hei.9-91197. However, the technology disclosed in those gazettes relate to a data communication between apparatuses dealing with data having mutually different data widths, such as a data communication between a central processing unit (CPU) and a peripheral unit, which deal with data having mutually different data widths, for example, between a CPU of 32 bits width and a memory of 16 bits width or 8 bits width. The technology disclosed in those gazettes relate to a data communication between apparatuses, which deal with data having a fixed bit width, while a data transmitting side and a data receiving side are concerned with mutually different bit widths. Such a technology is not applicable to a technology of converting various data widths of data into fixed data width of data.
In view of the foregoing, it is an object of the present invention to provide a data width conversion apparatus for efficiently converting data having various data widths sequentially generated into data each having a fixed data width and sequentially outputting the same, and a data processing apparatus for executing a receiving processing for input data and efficiently converting a result of the processing into output data of the fixed data width and outputting the same.
To achieve the above-mentioned object, the present invention provides a data width conversion apparatus for sequentially receiving a plurality of input data permitted in a matter that their data widths are mutually different from one another, converting the plurality of input data sequentially received into a predetermined fixed data width of output data and sequentially outputting the output data, said data width conversion apparatus comprising:
a buffer for storing output-incomplete partial data of the input data received in the past; and
a block shifter for combining the output-incomplete partial data stored in said buffer with new input data,
wherein when data width of combined data of the output-incomplete partial data stored in said buffer with new input data is less than the fixed data width, the combined data is stored in said buffer in form of the output-incomplete partial data, when the data width of the combined data is identical to the fixed data width, the combined data is outputted to an exterior in form of the output data, and when the data width of the combined data exceeds the fixed data width, of the combined data partial data consisting of a portion of same data width as the fixed data width is outputted to an exterior in form of the output data, and of the combined data partial data consisting of a portion excepting the portion of the same data width as the fixed data width is stored in said buffer in form of the output-incomplete partial data.
The data width conversion apparatus of the present invention has the buffer and the block shifter. The buffer stores therein a remaining partial data. The block shifter combines the partial data stored in the buffer with the newly entered input data to form a predetermined fixed data width of data. The predetermined fixed data width of data is outputted to the exterior whenever it is formed. A further remaining data is stored in the buffer. This sequence is repeated. This feature makes it possible to effectively convert input data having various data width into output data having the fixed data width.
While the present invention is comprehensively expressed as mentioned above, specifically, the present invention may be expressed as follows.
To achieve the above-mentioned object, the present invention provides a first data width conversion apparatus for sequentially receiving a plurality of input data permitted in a matter that their data widths are mutually different from one another, converting the plurality of input data sequentially received into a predetermined fixed data width of output data and sequentially outputting the output data, said data width conversion apparatus comprising:
first and second block shifters for receiving two types of data one of which is the input data to combine the two types of data and thereby outputting data having data width of a sum of data widths of the two types of data wherein the fixed data width is a maximum data width;
a selector for receiving total two types of data outputted from said first and second block shifters to output either one of the two types of data;
a slide buffer for storing therein the data outputted from said selector and outputting the stored data to an exterior in form of the output data when a data width of the stored data is identical to the fixed data width;
a barrel shifter for shifting the input data by an arbitrary number to extract and output a part of the input data; and
a temporary buffer for storing the data outputted from said barrel shifter,
wherein said first block shifter receives the input data and the data stored in said slide buffer,
said second block shifter receives the input data and the data stored in said temporary buffer,
said selector transmits the data outputted from said first block shifter to said slide buffer when said temporary buffer stores no effective data, and transmits the data outputted from said second block shifter to said slide buffer when said temporary buffer stores effective data, and
said barrel shifter extracts from new input data a portion exceeding the fixed data width of a combined data wherein the new input data is combined with the data stored in said temporary buffer when said temporary buffer stores effective data, or the data stored in said slide buffer when said temporary buffer stores no effective data, when a data width of the combined data exceeds the fixed data width, the extracted portion being transferred to said temporary buffer.
A combination of the first block shifter and the second block shifter in the first data width conversion apparatus corresponds to the block shifter in the data width conversion apparatus of the present invention which is comprehensively expressed. And a combination of the temporary buffer and the slide buffer in the first data width conversion apparatus corresponds to the buffer in the data width conversion apparatus of the present invention which is comprehensively expressed.
To achieve the above-mentioned object, the present invention provides a second data width conversion apparatus for sequentially receiving a plurality of input data permitted in a matter that their data widths are mutually different from one another, converting the plurality of input data sequentially received into a predetermined fixed data width of output data and sequentially outputting the output data, said data width conversion apparatus comprising:
first and second block shifters for receiving two types of data one of which is the input data to combine the two types of data and thereby outputting data having data width of a sum of data widths of the two types of data wherein the fixed data width is a maximum data width;
a slide buffer for storing therein the data outputted from said first block shifter and outputting the stored data to an exterior in form of the output data; and
a temporary buffer for storing the data outputted from said second block shifter,
wherein both of said first and second block shifters receive the input data and the data stored in said temporary buffer,
said first block shifter generates and transmits to said slide buffer a combined data wherein a new input data is combined with the data stored in said temporary buffer when a data width of the combined data is identical to the fixed data width, and generates and transmits to said slide buffer, of the combined data, partial data consisting of a portion of same data width as the fixed data width when the data width of the combined data exceeds the fixed data width, and
said second block shifter generates a combined data wherein a new input data is combined with the data stored in said temporary buffer when a data width of the combined data is less than the fixed data width, so that the combined data is stored in said temporary buffer, and generates and transmits to said temporary buffer partial data consisting of a portion excepting said partial data generated by said first block shifter when the data width of the combined data exceeds the fixed data width.
In the second data width conversion apparatus, in a similar fashion to the first data width conversion apparatus, a combination of the first block shifter and the second block shifter and a combination of the temporary buffer and the slide buffer correspond to the block shifter and the buffer in the data width conversion apparatus of the present invention which is comprehensively expressed, respectively.
To achieve the above-mentioned object, the present invention provides a third data width conversion apparatus for sequentially receiving a plurality of input data permitted in a matter that their data widths are mutually different from one another, converting the plurality of input data sequentially received into a predetermined fixed data width of output data and sequentially outputting the output data, said data width conversion apparatus comprising:
a block shifter for receiving two types of data one of which is the input data to combine the two types of data and thereby outputting data having data width of a sum of data widths of the two types of data wherein the fixed data width is a maximum data width;
a slide buffer for storing therein the data outputted from said block shifter and outputting the stored data to an exterior in form of the output data when a data width of the stored data is identical to the fixed data width;
a barrel shifter for shifting the input data by an arbitrary number to extract and output a part of the input data;
a temporary buffer for storing the data outputted from said barrel shifter, and
a selector for receiving the data stored in said temporary buffer and the data stored in said slide buffer to selectively output either one of two types of data,
wherein said selector transmits the data stored in said slide buffer to said block shifter when said temporary buffer stores no effective data, and transmits the data stored in said temporary buffer to said block shifter when said temporary buffer stores effective data, and
said barrel shifter extracts from new input data a portion exceeding the fixed data width of a combined data wherein the new input data is combined with the data stored in said temporary buffer when said temporary buffer stores effective data, or the data stored in said slide buffer when said temporary buffer stores no effective data, when a data width of the combined data exceeds the fixed data width, the extracted portion being transferred to said temporary buffer.
Here, the block shifter in the block shifter in the third data width conversion apparatus corresponds to the block shifter in the data width conversion apparatus of the present invention which is comprehensively expressed. And a combination of the slide buffer and the temporary buffer in the third data width conversion apparatus corresponds to the buffer in the data width conversion apparatus of the present invention which is comprehensively expressed.
To achieve the above-mentioned object, the present invention provides a data processing apparatus comprising:
a plurality of data processing sections for performing mutually different data processing to generate processed data, said plurality of data processing sections being permitted in a matter that generation of the processed data of mutually different data widths is permitted; and
a data width conversion section for sequentially receiving a plurality of processed data generated in said plurality of data processing sections, converting the plurality of processed data sequentially received into a predetermined fixed data width of output data and sequentially outputting the output data,
said data width conversion section comprising:
a buffer for storing output-incomplete partial data of the processed data received in the past; and
a block shifter for combining the output-incomplete partial data stored in said buffer with new processed data,
wherein when data width of combined data of the output-incomplete partial data stored in said buffer with new processed data is less than the fixed data width, the combined data is stored in said buffer in form of the output-incomplete partial data, when the data width of the combined data is identical to the fixed data width, the combined data is outputted to an exterior in form of the output data, and when the data width of the combined data exceeds the fixed data width, of the combined data partial data consisting of a portion of same data width as the fixed data width is outputted to an exterior in form of the output data, and of the combined data partial data consisting of a portion excepting the portion of the same data width as the fixed data width is stored in said buffer in form of the output-incomplete partial data.
Incidentally, in the data processing apparatus of the present invention as mentioned above, processing to be executed in the above-mentioned plurality of data processing sections is not restricted to specific processing, and any one is acceptable. A data width conversion apparatus constituting a data processing apparatus of the present invention includes all the aspects of the data width conversion apparatus of the present invention.